Conditions | 2 |
Total Lines | 31 |
Code Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | 1 | import React from "react"; |
|
31 | |||
32 | 1 | render() { |
|
33 | 8 | if (this.state.hasError) { |
|
34 | 2 | window.document.title = "Error"; |
|
35 | 2 | return ( |
|
36 | this.props.fallback || ( |
||
37 | <div |
||
38 | style={{ |
||
39 | width: "100vw", |
||
40 | height: "100vh", |
||
41 | display: "flex", |
||
42 | flexDirection: "column", |
||
43 | }} |
||
44 | > |
||
45 | <div style={{ margin: "auto" }}> |
||
46 | <Button |
||
47 | style={{ fontSize: "3rem", padding: "1rem" }} |
||
48 | className="error-button" |
||
49 | onClick={() => { |
||
50 | 1 | window.location.reload(); |
|
51 | }} |
||
52 | > |
||
53 | Try again |
||
54 | </Button> |
||
55 | </div> |
||
56 | </div> |
||
57 | ) |
||
58 | ); |
||
59 | } |
||
60 | |||
61 | 6 | return this.props.children; |
|
62 | } |
||
66 |